#!/usr/bin/env python
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php 

"""
Grabs Tweets on a per-user basis (200 at a time) using the Twitter REST API.
"""

import urllib

BASE_URL = "https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=%s&count=%d"


def GetTweets(user, count):
  """Return the most recent tweets from a given user (up to 200 of them)."""
  url = urllib.urlopen(BASE_URL % (user, count))
  return url.readlines()
